/**
 * Copyright (C), 2019-2020, 宇信融汇
 * FileName: CollectionTest
 * Author:   666
 * Date:     2020/7/8 23:22
 * Description: collection接口应用
 * History:
 * <author>          <time>          <version>          <desc>
 * 666           修改时间           版本号              描述
 */
package c_008.collection;

import org.junit.Test;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;

/**
 * @Classname CollectionTest
 * @Description TODO
 * @Date 2020/7/8 23:22
 * @Created by 666
 */
public class CollectionTest {

    @Test
    public  void test1(){
        Collection coll = new ArrayList();
        coll.add(123);
        coll.add("A");
        coll.add("b");
        coll.add(new Date());
        System.out.println(coll.size());
        Collection coll1 = new ArrayList();
        coll1.add("AA");
        coll1.add("BB");
        coll.addAll(coll1);
        System.out.println(coll);
        coll.clear();
        System.out.println(coll.isEmpty());


    }

    @Test
    public  void test2(){
        Collection coll = new ArrayList();
        coll.add(123);
        coll.add("A");
        coll.add("b");
        coll.add(new Person("张三",20));
        coll.add(new String("A"));
        coll.add(false);
        System.out.println(coll);
        System.out.println(coll.remove(12312));
        System.out.println(coll);

    }


    @Test
    public  void test3(){
        Collection coll = new ArrayList();
        Collection coll1 = new ArrayList();
        coll.add(123);
        coll.add("A");
        coll.add("b");
        coll.add(new Person("张三",20));
        coll.add(new String("A"));
        coll.add(false);

        coll1.add("A");
        coll.add(new Person("张三",20));
//        System.out.println(coll);
//        System.out.println(coll.remove(12312));
//        System.out.println(coll);.



    }
}
